home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 11 / Mac Magazin and MacEasy Magazine CD - Issue 11.iso / Sharewarebibliothek / Applikationen / xSortLab / About xSortLab next >
Text File  |  1995-05-31  |  6KB  |  116 lines

  1.  
  2.                                       June 1, 1995
  3.  
  4.  
  5. David Eck
  6. Department of Mathematics and Computer Science
  7. Hobart and William Smith Colleges
  8. Geneva, NY 14456   USA
  9. E-mail:  eck@hws.edu
  10. WWW:     http://hws3.hws.edu:9000/eck/index.html
  11.  
  12. xSortLab is a program for learning about and experimenting with five
  13. sorting algorithms:  bubble sort, selection sort, insertion sort,
  14. merge sort and quicksort.  The program has two modes of operation,
  15. visual and timed.  In visual mode, sixteen bars are sorted,
  16. step-by-step, according to size.  In timed mode, lists of numbers
  17. are sorted and the computer reports how long the sort took.
  18.  
  19. The program is easy to use; instructions are given below.
  20.  
  21. I wrote this program, and several others, for use with my
  22. introductory computer science textbook:  _The Most Complex Machine:
  23. A Survey of Computers and Computing_ (AK Peters Ltd, Wellesley, MA,
  24. ISBN number  1-56881-054-7), to be published in July of 1995.  You
  25. should find an order form for this book in the folder containing
  26. the program (just in case you are interested).  You can find
  27. information about the book and other programs on the World Wide Web
  28. at this URL:
  29.                   http://math.hws.edu/TMCM.html
  30.  
  31. COPYRIGHT RESTRICTIONS:  xSortLab  can be freely distributed for
  32. private, non-commercial use.  I stipulate, however, that this
  33. material should not be adopted for use in a course unless the book
  34. _The Most Complex Machine_ is also adopted.  This material can be
  35. included on inexpensive CD-ROM shareware collections.  It can be
  36. made available for downloading from FTP sites and on-line services,
  37. provided that no charge is made beyond such basic charges as
  38. connect time and membership fee.
  39.  
  40. ------------------------------------------------------------------------
  41.  
  42. Using xSortLab:
  43. --------------
  44.  
  45. xSortLab has two windows.  The "Sort Window" is used, along with the
  46. menus, for overall control of the program.  The Sort Window is visible
  47. when the program first starts up.  The "Log Window" displays statistics
  48. on sorts done by the program.  It is initially behind the Sort Window.
  49. There are commands in the File Menu for printing the data in the Log
  50. Window to a file and for saving the data to a file.
  51.  
  52. My recommended method for using xSortLab is to
  53.  
  54.     1) Start it up, and choose a sorting method from the Method
  55.        Menu.  You will see 16 bars lined up in random order, waiting
  56.        to be sorted.
  57.  
  58.     2) Click repeatedly on the Next button (or press Command-;) to
  59.        work through the sort one step at a time.  A message describing
  60.        each step will be displayed at the bottom of the window.  The
  61.        object here is to understand exactly how the sort works.  The
  62.        New Sort button can be used to randomize the order of the bars
  63.        and start over.
  64.  
  65.     3) Then, try the Go button to let the computer do the sort
  66.        automatically, while you watch.  The object here is to get
  67.        a better overall view of the process.  This automatic sorting
  68.        can be done at two speeds.  You can control the speed by
  69.        selecting either "Visual/Fast" or "Visual/Slow" from the
  70.        Speed Menu.
  71.  
  72.     4) Use the other two entries in the Speed Menu -- Timed/Uninterruptable
  73.        and Timed/Interruptable -- to gather statistics about the sort.
  74.        The statistics are reported in the Log Window.  The Timed/Interruptable
  75.        speed is useful for counting comparison and copy operations; it
  76.        also reports how long the sorting took, but most of this time is
  77.        overhead, so it should not be taken too seriously.  The
  78.        Timed/Uniterruptable sort reports only how long the process took.
  79.        This is the actual processing time required by your computer to
  80.        do the sorting.  A Timed/Uniterruptable sort is, in fact,
  81.        uninterruptable, except by aborting the program with Command-
  82.        Option-Escape or by restarting the computer.
  83.  
  84. Notes: 
  85.  
  86.    -- Time is measured in "ticks".  Each tick is equal to 1/60 second.
  87.       At computer speeds, this is a lot of time, and you will find that
  88.       the time reported for sorting a single small array is zero.  To get
  89.       a more accurate time, you should sort a large number of arrays of
  90.       the same size, and divide by the number of arrays.  When you use
  91.       the Timed/Interruptable or Timed/Uninterruptable sorting procedure,
  92.       two input boxes appear where you can type in the number of
  93.       arrays as well as the size of each array.  (Keeping track of
  94.       multiple arrays does add a certain amount of overhead to the
  95.       processing time, but except for very large numbers of small
  96.       arrays, it is negligible.  If you really want to be accurate,
  97.       you could try measuring the overhead by "sorting" a large number
  98.       of arrays of size 1.)
  99.  
  100.    -- The Method Menu is used to select one of five sorting methods.
  101.       If you select a new method while a "visual" sort is in progress,
  102.       the sort in progress will continue using the old method.  The 
  103.       new method will come into effect the next time you start a 
  104.       new sort.  The sort method that is actually in use at any given time
  105.       is displayed in the title bar of the Sort Window.
  106.  
  107.    -- The Control Menu contains commands that duplicate the functions of
  108.       the buttons in the Sort Window.  It also has commands for bringing
  109.       the Sort Window and the Log Window to the front and for clearing
  110.       the Log Window.
  111.  
  112.    -- The program's default memory allocation is set so that it can operate
  113.       on up to 200,000 items.  However, it can actually operate on up to
  114.       1,000,000 items if you increase the memory allocation.
  115.  
  116.